### 常见代码片段

#### localstoreage store

```typescript
class MyStore {
  remove(key: any): any {
    let savekey = this.prefix + JSON.stringify(key);
    this.cacheMap.delete(savekey);
    window.localStorage.removeItem(savekey);
  }
  prefix: string;
  cacheMap: Map<any, any>;
  constructor(prefix = "mystore__") {
    this.cacheMap = new Map();
    this.prefix = prefix;
  }
  save(key: string, value) {
    let savekey = this.prefix + JSON.stringify(key);
    this.cacheMap.set(savekey, value);
    window.localStorage.setItem(savekey, JSON.stringify(value));
  }
  get(key) {
    let savekey = this.prefix + JSON.stringify(key);
    let storevalue = window.localStorage.getItem(savekey);
    if (storevalue) {
      this.cacheMap.set(savekey, storevalue);
    }
  }
  getAll() {
    let self = this;
    let arr = [];
    for (let i = 0; i < localStorage.length; i++) {
      let key = localStorage.key(i);
      if (key.indexOf(self.prefix) > -1) {
        arr.push(JSON.parse(localStorage.getItem(key)));
      }
    }
    return arr;
  }
}
```

#### localtab

<div>
<a-tab>
    <a-tab-nav></a-tab-nav><a-tab-content>
    <a-tab-item title="angular" class="active">
        angular
    </a-tab-item>
    <a-tab-item title="vue">
        vue
    </a-tab-item>
    <a-tab-item title="webcomponent">
        webcomponent
    </a-tab-item></a-tab-content>   
<a-tab>
</div>
